<?php echo $header ?>
<?php //echo $slider ?>
<?php echo $googlemap; ?>


<div class="wrap-content">
    <div class="container">

        <h2>Real Estates</h2>
        <div class="options">
            <a class="view-type active" ref="grid" href="#"><img src="<?php echo base_url(); ?>assets/theme/blue/img/glyphicons/glyphicons_156_show_thumbnails.png" /></a>
            <a class="view-type" ref="list" href="#"><img src="<?php echo base_url(); ?>assets/theme/blue/img/glyphicons/glyphicons_157_show_thumbnails_with_lines.png" /></a>
            
            <select class="span3 selectpicker-small pull-right" placeholder="Sort">
                <option value="date ASC">By publish date ASC</option>
                <option value="date DESC">By publish date DESC</option>
            </select>
        </div>
         <br style="clear:both;" />
          <div class="row-fluid">
            <ul class="thumbnails">
            <?php foreach ($estates as $key => $item): 
                    $mainPhoto  = base_url() . "uploads/" . $item->photo;
                    $thumbPhoto = base_url() . "uploads/thumbs/" . $item->photo;
            ?>
                <li class="span3">
                    <div class="thumbnail">
                      <h3><?php echo $item->title ?></h3>
                      <img alt="300x200" data-src="holder.js/300x200"  style="width: 300px; height: 200px;" src="<?php echo (@getimagesize($mainPhoto)) ? $thumbPhoto : base_url() . "assets/theme/images/default.png" ?>" />
                        <?php echo date('d F Y', strtotime($item->addedDate)) ?>
                      <a href="<?php echo site_url() . "single/" . $item->id ?>" class="over-image"> </a>
                      <div class="caption">
                        <?php $photos = json_decode($item->photoGallery); ?>
                        <?php foreach ($photos as $photo) { ?>
                        <?php   $file = base_url() . "uploads/" . $photo;
                                $filethumb  = base_url() . "uploads/thumbs/" . $photo;
                                if (!@getimagesize($file)) {
                                    break;
                                }
                        ?>
                        <a href="<?php echo $file ?>" class="lightbox<?php echo $key ?>"><img src="<?php echo $filethumb ?>" width="75" height='75'/></a>
                        <?php } ?>
                        <p style="clear:both;">
                            <strong> <?php echo lang('content_estate_property') ?></strong>
                        </p>
                        <p class="bottom-border"><?php echo lang('content_heating') ?> <span><?php echo $item->heating ?></span></p>
                        <p class="bottom-border"><?php echo lang('content_bathroom') ?> <span><?php echo $item->bathroom ?></span></p>
                        <p class="bottom-border"><?php echo lang('content_buildstatus') ?> <span><?php echo $item->buildstatus ?></span></p>
                        <p class="bottom-border"><?php echo lang('content_room') ?> <span><?php echo $item->room ?></span></p>
                        <p class="bottom-border"><?php echo lang('content_estate_type') ?> <span><?php echo $item->estateName ?></span></p>
                        <p class="bottom-border"><?php echo lang('content_estate_floor') ?> <span><?php echo $item->floor ?></span></p>

                        <p class="prop-description"><i><?php echo substr(strip_tags($item->content), 0, 120) ?></i></p>
                        <p>
                        <a class="btn btn-info" href="<?php echo site_url() . "single/" . $item->id ?>">Details</a>
                        <span class="price"><?php echo number_format($item->price, 0, '.', ',') . lang('content_price_sembol'); ?></span>
                      </p>
                       
                      </div>
                    </div>
                  </li>
            <?php endforeach; ?>
            </ul>
          </div>  

            <br style="clear:both;" />
            <div class="row-fluid home-featured">
             <h2><?php echo lang('content_featured') ?></h2>
            <ul class="thumbnails">
            <?php foreach ($showcase as $item): 
                    $mainPhoto  = base_url() . "uploads/" . $item->photo;
                    $thumbPhoto = base_url() . "uploads/thumbs/" . $item->photo;
            ?>
                <li class="span3">
                    <div class="thumbnail">
                      <h3><?php echo $item->title ?></h3>
                      <img alt="300x200" data-src="holder.js/300x200"  style="width: 300px; height: 200px;" src="<?php echo (@getimagesize($mainPhoto)) ? $thumbPhoto : base_url() . "assets/theme/images/default.png" ?>" />
                        <?php echo date('d F Y', strtotime($item->addedDate)) ?>
                      <a href="<?php echo site_url() . "single/" . $item->id ?>" class="over-image"> </a>
                      <div class="caption">
                        <?php $photos = json_decode($item->photoGallery); ?>
                        <?php foreach ($photos as $photo) { ?>
                        <?php   $file = base_url() . "uploads/" . $photo;
                                $filethumb  = base_url() . "uploads/thumbs/" . $photo;
                                if (!@getimagesize($file)) {
                                    break;
                                }
                        ?>
                        <a href="<?php echo $file ?>" class="lightbox<?php echo $key ?>"><img src="<?php echo $filethumb ?>" width="75" height='75'/></a>
                        <?php } ?>
                        <p style="clear:both;">
                            <strong> <?php echo lang('content_estate_property') ?></strong>
                        </p>
                        <p class="bottom-border"><?php echo lang('content_heating') ?> <span><?php echo $item->heating ?></span></p>
                        <p class="bottom-border"><?php echo lang('content_bathroom') ?> <span><?php echo $item->bathroom ?></span></p>
                        <p class="bottom-border"><?php echo lang('content_buildstatus') ?> <span><?php echo $item->buildstatus ?></span></p>
                        <p class="bottom-border"><?php echo lang('content_room') ?> <span><?php echo $item->room ?></span></p>
                        <p class="bottom-border"><?php echo lang('content_estate_type') ?> <span><?php echo $item->estateName ?></span></p>
                        <p class="bottom-border"><?php echo lang('content_estate_floor') ?> <span><?php echo $item->floor ?></span></p>

                        <p class="prop-description"><i><?php echo substr(strip_tags($item->content), 0, 120) ?></i></p>
                        <p>
                        <a class="btn btn-info" href="<?php echo site_url() . "single/" . $item->id ?>">Details</a>
                        <span class="price"><?php echo number_format($item->price, 0, '.', ',') . lang('content_price_sembol'); ?></span>
                      </p>
                       
                      </div>
                    </div>
                  </li>
            <?php endforeach; ?>
            </ul>
          </div>  
       

    </div>
</div>        

<?php echo $footer ?>